<?php
	$mapping= array(
				'127.0.0.1'=>'deploy/index.php',
				'localhost'=>'deploy/index.php',
				);	
	function current_url() {  
        $isHTTPS = ( isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on" );  
        $isPort = ( isset($_SERVER["SERVER_PORT"]) && ((!$isHTTPS && $_SERVER["SERVER_PORT"] != "80")  
                     || ($isHTTPS && $_SERVER["SERVER_PORT"] != "443")));  
      
        $port = ( $isPort ) ? ( ':'.$_SERVER["SERVER_PORT"] ) : '';  
      
        //On some setups like nginx and php-fastcgi, REQUEST_URI include the query string  
        if ( ($pos = strpos($_SERVER['REQUEST_URI'], '?')) === false )  
        {  
            // REQUEST_URI include the query string, it should be appended:  
      
            $isQuery = ( isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != '');  
            $query = ( $isQuery ) ? ( '?'.$_SERVER["QUERY_STRING"] ) : '';  
      
            $url = ( $isHTTPS ? 'https://' : 'http://')  
                        .$_SERVER["SERVER_NAME"].$port.$_SERVER["REQUEST_URI"].$query;  
        }  
        else  
        {  
            // the query string is already included in $_SERVER["REQUEST_URI"], no need to append it  
            $url = ( $isHTTPS ? 'https://' : 'http://')  
                        .$_SERVER["SERVER_NAME"].$port.$_SERVER["REQUEST_URI"];  
        }  
      
        return $url;  
    }
	$domain=parse_url(current_url(), PHP_URL_HOST); 	
	$domainPath= $mapping[$domain];
	if(isset($domainPath))
		require_once($domainPath);
	else
		echo 'bad request.Please contact to admistrator';	